﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master" AutoEventWireup="true" CodeBehind="Account.aspx.cs" Inherits="Indochinaodyssey.Admin.Account" %>
<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            font-size: large;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
    <div>
            <asp:Panel ID="pnInfo" runat="server" CssClass="pnInfo" Visible="False">
                <fieldset>
                    <legend>
                        <asp:Label ID="lblInfo" runat="server" Text="Thông tin tài khoản"></asp:Label>
                    </legend>
                    <div>
                     <table width="100%">
                            <tr>
                                <td class="leftInfo">
                                    Họ và tên</td>
                                <td >
                                    <asp:TextBox ID="txtHoTen" runat="server" Width="500px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ControlToValidate="txtHoTen" Display="None" ErrorMessage="Không được rỗng"></asp:RequiredFieldValidator>
                                    <asp:ValidatorCalloutExtender ID="RequiredFieldValidator1_ValidatorCalloutExtender" 
                                        runat="server" Enabled="True" TargetControlID="RequiredFieldValidator1" 
                                        BehaviorID="ma1">
                                    </asp:ValidatorCalloutExtender>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftInfo">
                                    Tên đăng nhập</td>
                                <td >
                                    <asp:TextBox ID="txtTenDangNhap" runat="server" Width="300px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                        ControlToValidate="txtTenDangNhap" Display="None" 
                                        ErrorMessage="Không được rỗng"></asp:RequiredFieldValidator>
                                    <asp:ValidatorCalloutExtender ID="RequiredFieldValidator2_ValidatorCalloutExtender" 
                                        runat="server" Enabled="True" TargetControlID="RequiredFieldValidator2" 
                                        BehaviorID="ma2">
                                    </asp:ValidatorCalloutExtender>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftInfo">
                                    Mật khẩu</td>
                                <td >
                                    <asp:TextBox ID="txtMatKhau1" runat="server" TextMode="Password" Width="300px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                        ControlToValidate="txtMatKhau1" Display="None" ErrorMessage="Không được rỗng"></asp:RequiredFieldValidator>
                                    <asp:ValidatorCalloutExtender ID="RequiredFieldValidator3_ValidatorCalloutExtender" 
                                        runat="server" Enabled="True" TargetControlID="RequiredFieldValidator3" 
                                        BehaviorID="ma3">
                                    </asp:ValidatorCalloutExtender>
                                    <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                        ControlToCompare="txtMatKhau2" ControlToValidate="txtMatKhau1" Display="None" 
                                        ErrorMessage="Mật khẩu phải giống nhau"></asp:CompareValidator>
                                    <asp:ValidatorCalloutExtender ID="CompareValidator1_ValidatorCalloutExtender" 
                                        runat="server" Enabled="True" TargetControlID="CompareValidator1" 
                                        BehaviorID="ma4">
                                    </asp:ValidatorCalloutExtender>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftInfo">
                                    Nhập lại mật khẩu</td>
                                <td>
                                    <asp:TextBox ID="txtMatKhau2" runat="server" TextMode="Password" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftInfo">
                                    <%--<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                                    </asp:ToolkitScriptManager>--%>
                                    <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server">
                                    </asp:ToolkitScriptManager>
                                </td>
                                <td >
                                    <asp:Button ID="btnSave" runat="server" onclick="btnSave_Click" Text="Lưu" />
                                    &nbsp;
                                    <asp:Button ID="btnCancel" runat="server" PostBackUrl="~/Admin/Account.aspx" 
                                        Text="Hủy" CausesValidation="False" />
                                </td>
                            </tr>
                        </table>
                        </div>
                </fieldset>
            </asp:Panel>
    </div>
    <div>
        <table width="100%" >
            <tr>
                <td >
                        <span class="style1"><strong>Quản lý tài khoản</strong></span><asp:ObjectDataSource ID="odsAccount" runat="server" 
                            SelectMethod="GetAll" TypeName="IOBusiness.clsBSAdmin" 
                            DataObjectTypeName="IOEntity.clsAdmin" DeleteMethod="Delete" 
                            InsertMethod="Insert" UpdateMethod="Update">
                            <DeleteParameters>
                                <asp:Parameter Name="id" Type="Int32" />
                            </DeleteParameters>
                    </asp:ObjectDataSource>
                </td>
                <td align="right">
                    <asp:HyperLink ID="HyperLink1" runat="server" 
                            NavigateUrl="Account.aspx?action=new">Tạo mới &gt;&gt;</asp:HyperLink>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                            AutoGenerateColumns="False" CellPadding="4" DataSourceID="odsAccount" 
                            ForeColor="#333333" GridLines="None" Width="100%" 
                            onrowcommand="GridView1_RowCommand">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:BoundField DataField="Id" HeaderText="Mã" SortExpression="Id" />
                            <asp:BoundField DataField="Ten" HeaderText="Họ và tên" SortExpression="Ten" />
                            <asp:BoundField DataField="TenDangNhap" HeaderText="Tên đăng nhập" 
                                SortExpression="TenDangNhap" />
                            <asp:HyperLinkField DataNavigateUrlFields="Id" 
                                    DataNavigateUrlFormatString="Account.aspx?action=edit&amp;id={0}" 
                                Text="Sửa">
                            <ItemStyle Width="20px" />
                            </asp:HyperLinkField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtnXoa" runat="server" 
                                            onclientclick="return confirm('Bạn có muốn xóa không?')" 
                                            CommandArgument='<%# Eval("Id") %>' CommandName="Xoa">Xóa</asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle Width="40px" />
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#E9E7E2" />
                        <SortedAscendingHeaderStyle BackColor="#506C8C" />
                        <SortedDescendingCellStyle BackColor="#FFFDF8" />
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    <br />
</div>
</asp:Content>
